﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="RegisterORG.aspx.cs" Inherits="WuxiWTO.Web.RegisterORG" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <script type="text/javascript">

        function checkuser() {
            var name = document.getElementById("<%=txtLoginNameP.ClientID %>").value;
            if (name == "") {
                $("#displayMsg").css("display", "");
                $("#displayMsg").html("*");
                return false;
            }
            else {
                $.ajax({ type: "POST", async: true, url: "checkLogin.ashx", data: { uname: name },
                    success: function (msg) {
                        $("#displayMsg").css("display", "");
                        if (msg == "Y") {
                            $("#displayMsg").html("该用户名已经被注册！"); return false;
                        }
                        else if (msg == "N") {
                            $("#displayMsg").html("该用户名可以注册"); return true;
                        }
                        else {
                            $("#displayMsg").html("错误"); return false;
                        }
                    },
                    error: function (jqXHR, textStatus, errorThrown) {
                        $("#displayMsg").html("错误"); return false;
                    }
                });
            }
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div id="content" class="main_con">
        <h1 class="main_con_title">
            注册新用户</h1>
        <div id="login">
            <asp:Panel ID="panLogin" runat="server">
                <table id="perReg" class="login_tb" cellspacing="0" cellpadding="0" width="500">
                    <tr>
                        <td align="right" style="width: 70px;">
                            <label>
                                用户名：</label>
                        </td>
                        <td>
                            <asp:TextBox runat="server" CssClass="txt3" ID="txtLoginNameP" MaxLength="10" />
                            <input type="button" value="检测用户名是否可用" class="bt_check" onclick="checkuser()" />
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" CssClass="red" ControlToValidate="txtLoginNameP"
                                runat="server" ErrorMessage="*"></asp:RequiredFieldValidator><br />
                            <span id="displayMsg" class="red" style="display: none;"></span>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <label>
                                密码：</label>
                        </td>
                        <td>
                            <asp:TextBox runat="server" CssClass="txt3" ID="txtPasswordP" TextMode="Password"
                                MaxLength="20" />
                            <asp:RequiredFieldValidator ID="rfv2" CssClass="red" ControlToValidate="txtPasswordP"
                                runat="server" ErrorMessage="*"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <label>
                                确认密码：</label>
                        </td>
                        <td>
                            <asp:TextBox runat="server" CssClass="txt3" ID="txtPassword2" TextMode="Password" />
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" CssClass="red" ControlToValidate="txtPassword2"
                                runat="server" ErrorMessage="*"></asp:RequiredFieldValidator>
                            <br />
                            <asp:CompareValidator ID="cv1" ControlToCompare="txtPasswordP" CssClass="red" Display="Dynamic"
                                ControlToValidate="txtPassword2" runat="server" ErrorMessage="两次密码不一致"></asp:CompareValidator>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <label>
                                邮箱：</label>
                        </td>
                        <td>
                            <asp:TextBox runat="server" CssClass="txt3" ID="txtEmailP" MaxLength="30" />
                            <asp:RequiredFieldValidator ID="rfv3" CssClass="red" ControlToValidate="txtEmailP"
                                runat="server" ErrorMessage="*"></asp:RequiredFieldValidator><br />
                            <asp:RegularExpressionValidator ID="revEmail" runat="server" Display="Dynamic" ControlToValidate="txtEmailP"
                                ErrorMessage="邮件格式不正确" CssClass="red" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <label>
                                企业名称：</label>
                        </td>
                        <td>
                            <asp:TextBox runat="server" CssClass="txt3" ID="txtNameP" MaxLength="40" />
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator4" CssClass="red" ControlToValidate="txtNameP"
                                runat="server" ErrorMessage="*"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <label>
                                联系人：</label>
                        </td>
                        <td>
                            <asp:TextBox runat="server" CssClass="txt3" ID="txtContact" MaxLength="10" />
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator5" CssClass="red" ControlToValidate="txtContact"
                                runat="server" ErrorMessage="*"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <label>
                                职务：</label>
                        </td>
                        <td>
                            <asp:TextBox runat="server" CssClass="txt3" ID="txtPosition" MaxLength="10" />
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <label>
                                手机：</label>
                        </td>
                        <td>
                            <asp:TextBox runat="server" CssClass="txt3" ID="txtTelephoneP" MaxLength="15" />
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <label>
                                地址：</label>
                        </td>
                        <td>
                            <asp:TextBox runat="server" CssClass="txt3" ID="txtAddress" MaxLength="50" />
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" CssClass="red" ControlToValidate="txtAddress"
                                runat="server" ErrorMessage="*"></asp:RequiredFieldValidator><br />
                        </td>
                    </tr>
                </table>
                <table class="login_tb" cellspacing="0" cellpadding="0" width="400">
                    <tr>
                        <td>
                            &nbsp;
                        </td>
                        <td>
                            <asp:Button ID="btnOK" Text="现在注册" class="bt_register" runat="server" OnClick="btnOK_Click" />
                        </td>
                    </tr>
                </table>
            </asp:Panel>
            <asp:Panel ID="panHidLogin" runat="server">
                <table class="login_tb" cellspacing="0" cellpadding="0" width="400" style="height: 200px;">
                    <tr valign="middle">
                        <td align="center">
                            <asp:Label ID="lblMessage" runat="server" ForeColor="Red" Font-Bold="true" Text="当前网站的注册功能已经暂停，请稍后再试"></asp:Label>
                        </td>
                    </tr>
                </table>
            </asp:Panel>
        </div>
    </div>
</asp:Content>
